package yc.star.friend.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import yc.star.common.controller.BaseController;
import yc.star.common.domain.AppResult;
import yc.star.common.domain.TableDataInfo;
import yc.star.friend.domain.question.dto.QuestionQueryDTO;
import yc.star.friend.domain.question.vo.QuestionDetailVO;
import yc.star.friend.service.IQuestionService;

@RequestMapping("/question")
@RestController
public class QuestionController extends BaseController {

    @Autowired
    private IQuestionService questionService;

    @GetMapping("/semiLogin/list")
    public TableDataInfo list (QuestionQueryDTO questionQueryDTO) {
        return questionService.list(questionQueryDTO);
    }

    @GetMapping("/detail")
    public AppResult<QuestionDetailVO> detail (Long questionId) {
        return AppResult.success(questionService.detail(questionId));
    }

    @GetMapping("/preQuestion")
    public AppResult<String> preQuestion(Long questionId) {
        return AppResult.success(questionService.preQuestion(questionId));
    }

    @GetMapping("/nextQuestion")
    public AppResult<String> nextQuestion(Long questionId) {
        return AppResult.success(questionService.nextQuestion(questionId));
    }

}